gboolean ret = FALSE;
GFileInfo *info = NULL;
- if (!_ostree_repo_file_tree_query_child (self->dir, self->index,
- self->attributes, self->flags,
- &info, cancellable, error))
+ if (!ostree_repo_file_tree_query_child (self->dir, self->index,
+ self->attributes, self->flags,
+ &info, cancellable, error))
goto out;
self->index++;
GFileEnumeratorClass parent_class;
};
+G_GNUC_INTERNAL
GType _ostree_repo_file_enumerator_get_type (void) G_GNUC_CONST;
+G_GNUC_INTERNAL
GFileEnumerator * _ostree_repo_file_enumerator_new (OstreeRepoFile *dir,
const char *attributes,
GFileQueryInfoFlags flags,
GVariant *tree_metadata;
};
-#define ostree_repo_file_get_type _ostree_repo_file_get_type
G_DEFINE_TYPE_WITH_CODE (OstreeRepoFile, ostree_repo_file, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_FILE,
ostree_repo_file_file_iface_init))
}
GFile *
-_ostree_repo_file_new_root (OstreeRepo *repo,
+ostree_repo_file_new_root (OstreeRepo *repo,
const char *commit)
{
OstreeRepoFile *self;
GFile *
-_ostree_repo_file_new_child (OstreeRepoFile *parent,
+ostree_repo_file_new_child (OstreeRepoFile *parent,
const char *name)
{
OstreeRepoFile *self;
gboolean is_dir;
int i;
- i = _ostree_repo_file_tree_find_child (self->parent, self->name, &is_dir, &container);
+ i = ostree_repo_file_tree_find_child (self->parent, self->name, &is_dir, &container);
if (i < 0)
{
}
gboolean
-_ostree_repo_file_ensure_resolved (OstreeRepoFile *self,
+ostree_repo_file_ensure_resolved (OstreeRepoFile *self,
GError **error)
{
if (self->commit_resolve_error != NULL)
}
else if (self->index == -1)
{
- if (!_ostree_repo_file_ensure_resolved (self->parent, error))
+ if (!ostree_repo_file_ensure_resolved (self->parent, error))
goto out;
(void)do_resolve_nonroot (self, &(self->commit_resolve_error));
}
}
gboolean
-_ostree_repo_file_get_xattrs (OstreeRepoFile *self,
+ostree_repo_file_get_xattrs (OstreeRepoFile *self,
GVariant **out_xattrs,
GCancellable *cancellable,
GError **error)
GVariant *metadata = NULL;
GFile *local_file = NULL;
- if (!_ostree_repo_file_ensure_resolved (self, error))
+ if (!ostree_repo_file_ensure_resolved (self, error))
goto out;
if (self->tree_metadata)
ret_xattrs = g_variant_get_child_value (self->tree_metadata, 4);
else if (ostree_repo_get_mode (self->repo) == OSTREE_REPO_MODE_ARCHIVE)
{
- local_file = _ostree_repo_file_nontree_get_local (self);
+ local_file = ostree_repo_file_nontree_get_local (self);
if (!ostree_map_metadata_file (local_file, OSTREE_OBJECT_TYPE_ARCHIVED_FILE_META,
&metadata, error))
}
else
{
- local_file = _ostree_repo_file_nontree_get_local (self);
+ local_file = ostree_repo_file_nontree_get_local (self);
ret_xattrs = ostree_get_xattrs_for_file (local_file, error);
}
}
GVariant *
-_ostree_repo_file_tree_get_contents (OstreeRepoFile *self)
+ostree_repo_file_tree_get_contents (OstreeRepoFile *self)
{
return self->tree_contents;
}
GVariant *
-_ostree_repo_file_tree_get_metadata (OstreeRepoFile *self)
+ostree_repo_file_tree_get_metadata (OstreeRepoFile *self)
{
return self->tree_metadata;
}
void
-_ostree_repo_file_tree_set_metadata (OstreeRepoFile *self,
+ostree_repo_file_tree_set_metadata (OstreeRepoFile *self,
const char *checksum,
GVariant *metadata)
{
}
const char *
-_ostree_repo_file_tree_get_content_checksum (OstreeRepoFile *self)
+ostree_repo_file_tree_get_content_checksum (OstreeRepoFile *self)
{
return self->tree_contents_checksum;
}
GFile *
-_ostree_repo_file_nontree_get_local (OstreeRepoFile *self)
+ostree_repo_file_nontree_get_local (OstreeRepoFile *self)
{
- return ostree_repo_get_file_object_path (self->repo, _ostree_repo_file_get_checksum (self));
+ return ostree_repo_get_file_object_path (self->repo, ostree_repo_file_get_checksum (self));
}
OstreeRepo *
-_ostree_repo_file_get_repo (OstreeRepoFile *self)
+ostree_repo_file_get_repo (OstreeRepoFile *self)
{
return self->repo;
}
OstreeRepoFile *
-_ostree_repo_file_get_root (OstreeRepoFile *self)
+ostree_repo_file_get_root (OstreeRepoFile *self)
{
OstreeRepoFile *parent = self;
}
const char *
-_ostree_repo_file_get_checksum (OstreeRepoFile *self)
+ostree_repo_file_get_checksum (OstreeRepoFile *self)
{
int n;
gboolean is_dir;
if (!self->parent)
return self->tree_metadata_checksum;
- n = _ostree_repo_file_tree_find_child (self->parent, self->name, &is_dir, NULL);
+ n = ostree_repo_file_tree_find_child (self->parent, self->name, &is_dir, NULL);
g_assert (n >= 0);
files_variant = g_variant_get_child_value (self->parent->tree_contents, 2);
OstreeRepoFile *self = OSTREE_REPO_FILE (file);
if (self->parent)
- return _ostree_repo_file_new_child (self->parent, self->name);
+ return ostree_repo_file_new_child (self->parent, self->name);
else
- return _ostree_repo_file_new_root (self->repo, self->commit);
+ return ostree_repo_file_new_root (self->repo, self->commit);
}
static guint
g_assert (*relative_path == '/');
if (strcmp (relative_path, "/") == 0)
- return g_object_ref (_ostree_repo_file_get_root (self));
+ return g_object_ref (ostree_repo_file_get_root (self));
if (self->parent)
- return ostree_repo_file_resolve_relative_path ((GFile*)_ostree_repo_file_get_root (self),
+ return ostree_repo_file_resolve_relative_path ((GFile*)ostree_repo_file_get_root (self),
relative_path+1);
else
relative_path = relative_path+1;
else
filename = g_strdup (relative_path);
- parent = (OstreeRepoFile*)_ostree_repo_file_new_child (self, filename);
+ parent = (OstreeRepoFile*)ostree_repo_file_new_child (self, filename);
g_free (filename);
if (!rest)
}
int
-_ostree_repo_file_tree_find_child (OstreeRepoFile *self,
+ostree_repo_file_tree_find_child (OstreeRepoFile *self,
const char *name,
gboolean *is_dir,
GVariant **out_container)
}
gboolean
-_ostree_repo_file_tree_query_child (OstreeRepoFile *self,
+ostree_repo_file_tree_query_child (OstreeRepoFile *self,
int n,
const char *attributes,
GFileQueryInfoFlags flags,
GFileAttributeMatcher *matcher = NULL;
int c;
- if (!_ostree_repo_file_ensure_resolved (self, error))
+ if (!ostree_repo_file_ensure_resolved (self, error))
goto out;
matcher = g_file_attribute_matcher_new (attributes);
gboolean ret = FALSE;
GFileInfo *info = NULL;
- if (!_ostree_repo_file_ensure_resolved (self, error))
+ if (!ostree_repo_file_ensure_resolved (self, error))
goto out;
if (!self->parent)
}
else
{
- if (!_ostree_repo_file_tree_query_child (self->parent, self->index,
+ if (!ostree_repo_file_tree_query_child (self->parent, self->index,
attributes, flags,
&info, cancellable, error))
goto out;
}
else
{
- local_file = _ostree_repo_file_nontree_get_local (self);
+ local_file = ostree_repo_file_nontree_get_local (self);
ret_stream = g_file_read (local_file, cancellable, error);
if (!ret_stream)
goto out;
G_BEGIN_DECLS
-#define OSTREE_TYPE_REPO_FILE (_ostree_repo_file_get_type ())
+#define OSTREE_TYPE_REPO_FILE (ostree_repo_file_get_type ())
#define OSTREE_REPO_FILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), OSTREE_TYPE_REPO_FILE, OstreeRepoFile))
#define OSTREE_REPO_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), OSTREE_TYPE_REPO_FILE, OstreeRepoFileClass))
#define OSTREE_IS_REPO_FILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), OSTREE_TYPE_REPO_FILE))
GObjectClass parent_class;
};
-GType _ostree_repo_file_get_type (void) G_GNUC_CONST;
+GType ostree_repo_file_get_type (void) G_GNUC_CONST;
-GFile * _ostree_repo_file_new_root (OstreeRepo *repo,
+GFile * ostree_repo_file_new_root (OstreeRepo *repo,
const char *commit);
-GFile * _ostree_repo_file_new_child (OstreeRepoFile *parent,
+GFile * ostree_repo_file_new_child (OstreeRepoFile *parent,
const char *name);
-gboolean _ostree_repo_file_ensure_resolved (OstreeRepoFile *self,
+gboolean ostree_repo_file_ensure_resolved (OstreeRepoFile *self,
GError **error);
-gboolean _ostree_repo_file_get_xattrs (OstreeRepoFile *self,
+gboolean ostree_repo_file_get_xattrs (OstreeRepoFile *self,
GVariant **out_xattrs,
GCancellable *cancellable,
GError **error);
-OstreeRepo * _ostree_repo_file_get_repo (OstreeRepoFile *self);
-OstreeRepoFile * _ostree_repo_file_get_root (OstreeRepoFile *self);
+OstreeRepo * ostree_repo_file_get_repo (OstreeRepoFile *self);
+OstreeRepoFile * ostree_repo_file_get_root (OstreeRepoFile *self);
-void _ostree_repo_file_make_empty_tree (OstreeRepoFile *self);
+void ostree_repo_file_make_empty_tree (OstreeRepoFile *self);
-void _ostree_repo_file_tree_set_metadata (OstreeRepoFile *self,
+void ostree_repo_file_tree_set_metadata (OstreeRepoFile *self,
const char *checksum,
GVariant *metadata);
-void _ostree_repo_file_tree_set_content_checksum (OstreeRepoFile *self,
+void ostree_repo_file_tree_set_content_checksum (OstreeRepoFile *self,
const char *checksum);
-const char *_ostree_repo_file_tree_get_content_checksum (OstreeRepoFile *self);
+const char *ostree_repo_file_tree_get_content_checksum (OstreeRepoFile *self);
-gboolean _ostree_repo_file_is_tree (OstreeRepoFile *self);
+gboolean ostree_repo_file_is_tree (OstreeRepoFile *self);
-const char * _ostree_repo_file_get_checksum (OstreeRepoFile *self);
+const char * ostree_repo_file_get_checksum (OstreeRepoFile *self);
-GFile *_ostree_repo_file_nontree_get_local (OstreeRepoFile *self);
+GFile *ostree_repo_file_nontree_get_local (OstreeRepoFile *self);
-int _ostree_repo_file_tree_find_child (OstreeRepoFile *self,
+int ostree_repo_file_tree_find_child (OstreeRepoFile *self,
const char *name,
gboolean *is_dir,
GVariant **out_container);
-gboolean _ostree_repo_file_tree_query_child (OstreeRepoFile *self,
+gboolean ostree_repo_file_tree_query_child (OstreeRepoFile *self,
int n,
const char *attributes,
GFileQueryInfoFlags flags,
GCancellable *cancellable,
GError **error);
-GVariant *_ostree_repo_file_tree_get_contents (OstreeRepoFile *self);
-GVariant *_ostree_repo_file_tree_get_metadata (OstreeRepoFile *self);
+GVariant *ostree_repo_file_tree_get_contents (OstreeRepoFile *self);
+GVariant *ostree_repo_file_tree_get_metadata (OstreeRepoFile *self);
G_END_DECLS
GFile *content_object_path = NULL;
GInputStream *content_input = NULL;
- if (!_ostree_repo_file_get_xattrs (source, &xattrs, NULL, error))
+ if (!ostree_repo_file_get_xattrs (source, &xattrs, NULL, error))
goto out;
if (!checkout_file_from_input (destination, mode, source_info,
}
else
{
- const char *checksum = _ostree_repo_file_get_checksum ((OstreeRepoFile*)src_child);
+ const char *checksum = ostree_repo_file_get_checksum ((OstreeRepoFile*)src_child);
if (priv->mode == OSTREE_REPO_MODE_ARCHIVE && mode == OSTREE_REPO_CHECKOUT_MODE_USER)
{
if (!ostree_repo_resolve_rev (self, ref, FALSE, &resolved, error))
goto out;
- root = (OstreeRepoFile*)_ostree_repo_file_new_root (self, resolved);
- if (!_ostree_repo_file_ensure_resolved (root, error))
+ root = (OstreeRepoFile*)ostree_repo_file_new_root (self, resolved);
+ if (!ostree_repo_file_ensure_resolved (root, error))
goto out;
root_info = g_file_query_info ((GFile*)root, OSTREE_GIO_FAST_QUERYINFO,
if (OSTREE_IS_REPO_FILE (f))
{
- ret_checksum = g_strdup (_ostree_repo_file_get_checksum ((OstreeRepoFile*)f));
+ ret_checksum = g_strdup (ostree_repo_file_get_checksum ((OstreeRepoFile*)f));
}
else
{
if (!ostree_repo_resolve_rev (self, rev, FALSE, &resolved_rev, error))
goto out;
- ret_root = _ostree_repo_file_new_root (self, resolved_rev);
- if (!_ostree_repo_file_ensure_resolved ((OstreeRepoFile*)ret_root, error))
+ ret_root = ostree_repo_file_new_root (self, resolved_rev);
+ if (!ostree_repo_file_ensure_resolved ((OstreeRepoFile*)ret_root, error))
goto out;
ret = TRUE;
#include <ostree-repo.h>
#include <ostree-checkout.h>
#include <ostree-mutable-tree.h>
+#include <ostree-repo-file.h>
#endif
guint32 mode;
guint32 type;
- if (!_ostree_repo_file_ensure_resolved ((OstreeRepoFile*)f, NULL))
+ if (!ostree_repo_file_ensure_resolved ((OstreeRepoFile*)f, NULL))
g_assert_not_reached ();
buf = g_string_new ("");
if (checksum)
{
if (type == G_FILE_TYPE_DIRECTORY)
- g_string_append_printf (buf, "%s ", _ostree_repo_file_tree_get_content_checksum ((OstreeRepoFile*)f));
- g_string_append_printf (buf, "%s ", _ostree_repo_file_get_checksum ((OstreeRepoFile*)f));
+ g_string_append_printf (buf, "%s ", ostree_repo_file_tree_get_content_checksum ((OstreeRepoFile*)f));
+ g_string_append_printf (buf, "%s ", ostree_repo_file_get_checksum ((OstreeRepoFile*)f));
}
if (xattrs)
GVariant *xattrs;
char *formatted;
- if (!_ostree_repo_file_get_xattrs ((OstreeRepoFile*)f, &xattrs, NULL, NULL))
+ if (!ostree_repo_file_get_xattrs ((OstreeRepoFile*)f, &xattrs, NULL, NULL))
g_assert_not_reached ();
formatted = g_variant_print (xattrs, TRUE);